Skip to content

ci: Gate size analysis on ready-to-merge label for PRs#5963

Open
antonis wants to merge 1 commit intomainfrom
antonis/ci/size-analysis-ready-to-merge-gate
Open

ci: Gate size analysis on ready-to-merge label for PRs#5963
antonis wants to merge 1 commit intomainfrom
antonis/ci/size-analysis-ready-to-merge-gate

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented Apr 7, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds the ready-to-merge label gate to the Size Analysis workflow, matching the pattern used by other expensive CI workflows (native tests, E2E, sample builds).

  • On PRs: jobs only run when the ready-to-merge label is present
  • On main pushes: jobs run unconditionally (gate passes through)

💡 Motivation and Context

The size analysis workflow builds full iOS and Android sample apps, which is expensive. Gating it behind ready-to-merge saves CI resources on PRs that aren't ready yet.

💚 How did you test it?

Verified the workflow follows the same pattern as native-tests.yml, e2e-v2.yml, sample-application.yml, and sample-application-expo.yml.

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • ci: Gate size analysis on ready-to-merge label for PRs by antonis in #5963
  • fix(core): Lazy-load Metro internal modules to prevent Expo 55 import errors by lucas-zimerman in #5958
  • chore(deps): update Cocoa SDK to v9.9.0 by github-actions in #5956
  • chore(deps): update Maestro to v2.4.0 by github-actions in #5955
  • Feat: Fallback to stacktrace parsing by lucas-zimerman in #5946
  • fix(ci): Bump Node to 22 in size-analysis and testflight workflows by antonis in #5954
  • feat(playground): Open Sentry in desktop browser from Expo apps by antonis in #5947
  • chore(core): Bump sample app to React Native 0.84.1 by antonis in #5941
  • Size analysis for React Native SDK by alwx in #5949
  • chore(deps): bump lodash from 4.17.23 to 4.18.1 by dependabot in #5953
  • chore(deps): bump yauzl to ^3.2.1 by antonis in #5950
  • chore(deps): bump brace-expansion to ^2.0.3 by antonis in #5951
  • chore(deps): bump @xmldom/xmldom to fix XML injection by antonis in #5952

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against 6c98311

@antonis antonis marked this pull request as ready for review April 7, 2026 10:55
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Missing labeled event type breaks ready-to-merge gate
    • Added types: [opened, synchronize, reopened, labeled] to the pull_request trigger in size-analysis.yml so adding the ready-to-merge label re-runs the workflow gate.

Create PR

Or push these changes by commenting:

@cursor push 4768a9d168
Preview (4768a9d168)
diff --git a/.github/workflows/size-analysis.yml b/.github/workflows/size-analysis.yml
--- a/.github/workflows/size-analysis.yml
+++ b/.github/workflows/size-analysis.yml
@@ -9,6 +9,7 @@
       - 'samples/react-native/**'
       - '.github/workflows/size-analysis.yml'
   pull_request:
+    types: [opened, synchronize, reopened, labeled]
     paths:
       - 'packages/**'
       - 'samples/react-native/**'

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6c98311. Configure here.

RN_SENTRY_POD_NAME: RNSentry

jobs:
ready-to-merge-gate:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing labeled event type breaks ready-to-merge gate

High Severity

The pull_request trigger is missing types: [opened, synchronize, reopened, labeled]. Without the labeled type, adding the ready-to-merge label won't re-trigger the workflow. The gate will fail on initial PR events (no label yet), and the workflow will never re-run when the label is added — effectively blocking size analysis on all PRs. Every other workflow using this gate pattern (native-tests.yml, e2e-v2.yml, sample-application.yml, sample-application-expo.yml) includes the labeled event type.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 6c98311. Configure here.

Comment on lines 26 to 28
RN_SENTRY_POD_NAME: RNSentry

jobs:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The size-analysis.yml workflow won't trigger when a label is added to a pull request because the on.pull_request trigger is missing the labeled activity type.
Severity: MEDIUM

Suggested Fix

Add labeled to the list of activity types under the on.pull_request trigger in the .github/workflows/size-analysis.yml file. This will ensure the workflow is triggered when labels are added to pull requests.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/size-analysis.yml#L26-L28

Potential issue: The `size-analysis.yml` workflow is configured to trigger on pull
requests, but it is missing the `labeled` activity type. As a result, when a label such
as `ready-to-merge` is added to a pull request, the size analysis job will not be
initiated. If this job is a required status check for merging, the pull request will be
blocked from merging because the check will remain in a pending state indefinitely.

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant